package com.dongdongshop.controller;

import com.dongdongshop.pojo.TbItemCat;
import com.dongdongshop.service.ItemCatService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class SellerCommonController {

    @DubboReference
    private ItemCatService itemCatService;

    @RequestMapping("toHome")
    public String toHome() {

        return "admin/home";
    }

    @RequestMapping("/")
    public String toLogin() {

        return "shoplogin";
    }

    @RequestMapping("toRegister")
    public String toRegister() {

        return "register";
    }

    @RequestMapping("toIndex")
    public String toIndex() {

        return "admin/index";
    }

    @RequestMapping("toAddGoods")
    public String toAddGoods(Model model) {
        List<TbItemCat> itemList = itemCatService.getItemInfo(0L);

        model.addAttribute("it", itemList);

        return "admin/goods_edit";
    }
}
